package com.zenika.zenbinding.client.converter;

import com.zenika.zenbinding.client.exception.ConverterException;

/**
 * Interface for converters. Converters are used by models to translate object
 * to string and string to object. There is one implementation for each object
 * type.
 * @author Zenika
 */
public interface Converter {

	/**
	 * Convert an Object to a String.
	 * @param object Object to convert
	 * @return String
	 * @throws ConverterException
	 */
	public String fromObjectToString(Object object) throws ConverterException;

	/**
	 * Convert a String to an Object.
	 * @param string String to convert
	 * @return Object
	 * @throws ConverterException
	 */
	public Object fromStringToObject(String string) throws ConverterException;
}
